package com.ytkj.ygAssist.tools;

public class MyLog {
	public boolean isRun = true;

	public static void outLog(String name, Object... value) {
		if (Config.isServerVersions) {
			StringBuffer stringBuffer = new StringBuffer("输出:");
			stringBuffer.append(name);
			for (int i = 0; i < value.length; i++) {
				stringBuffer.append(":").append(value[i]);
			}
			System.out.println(stringBuffer.toString());
		}
	}

	public static void testLog(String name, Object... value) {
		if (Config.isServerVersions) {
			StringBuffer stringBuffer = new StringBuffer("调试:");
			stringBuffer.append(name);
			for (int i = 0; i < value.length; i++) {
				stringBuffer.append(":").append(value[i]);
			}
			System.out.println(stringBuffer.toString());
		}
	}

	public static void threadSleep(long time) {
		try {
			Thread.sleep(time);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	public static void threadSleep(long time, MyLog timeType) {
		int i = 0;
		while (timeType.isRun && i < time) {
			try {
				Thread.sleep(1);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			i++;
		}
	}

}
